

section .data 

LC0:
	db "This is From Dll!",0ah,0

LC1:
	db "OK",0

LC2:
	db "stack check fail!",0ah,0

extern _exit,_printf,_MessageBoxA@16
section .text 
_DllMain:
	push ebp
	mov ebp,esp 
	sub esp,0x1000
	
	push ebx
	push esi
	push edi
	
	; [ebp+8] hModule
	; [ebp+12] ul_reason_for_call 
	; [ebp+16] lpReserved 
	
	cmp dword [ebp+12], 1
	jne .LDllMain_10
	
	mov esi,esp 
	push 0
	push LC1 
	push LC0
	push 0 
	call _MessageBoxA@16
	cmp esi,esp 
	call _cs 
	
.LDllMain_10:
	mov eax,1
	pop edi 
	pop esi
	pop ebx 
	add esp,0x1000 
	leave
	ret 
	
	
_cs:
	je .Lcs_0
	
	push LC2 
	call _printf 
	
	push 0
	call _exit 
	
.Lcs_0:
	ret 